package com.wisely.highlight_spring4.ch3.aware;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author GY
 * 2018年1月30日
 * Spring Aware 的目的是为了让Bean获取Spring容器的服务
 */
public class Main {
	public static void main(String[] args) {
		
		AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(AwareConfig.class);
		AwareService awareService =context.getBean(AwareService.class); //(AwareService) context.getBean("awareService");
		awareService.outputResult();
		
		context.close();
	}
}
